//声明变量a 指定类型为number
let a: number;
a = 10;
a = 33;

//声明变量b 指定类型为string
let b: string;
b = 'hello';

//声明+赋值
let c: boolean = false;
c = true;

//声明和赋值同时进行 ts可自行判断变量类型
let d = true;
d = false;

//类型声明可用于参数和函数返回值
function sum(a: number, b: number): number {
  return a + b
}
let result = sum(123, 456)